import React from 'react'

import {WeaLocaleProvider} from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;

import './style'
import ContainerModle from '../../common/containerModle'
import AddExtend from './addExtend'
import SettingExtend from './settingExtend'
import SettingProxy from './settingProxy'
import ContainerViewExtend from './containerViewExtend'
import ContainerViewProxy from './containerViewProxy'


export default class CustomPage extends React.Component{

    static defaultProps = {
        javaInterface:{
            find: '/api/portalTsLogin/element/getCustomPageData',
            save: '/api/portalTs/customPage/save',
            update: '/api/portalTs/customPage/update',
            saveOrUpdateItem: '/api/portalTs/customPage/saveOrUpdateItem',
            deleteItem: '/api/portalTs/customPage/deleteItem',
            orderItem: '/api/portalTs/customPage/orderItem',
        }
    }

    onSaveBeforeHandler = (setting={})=>{
        setting.title = getLabel(502733, '自定义页面')

    }


    render(){

        return (
            <ContainerModle ecId={`${this && this.props && this.props.ecId || ''}_ContainerModle@nzturq`} {...this.props} {...(this.props.location ? this.props.location.query :{})} ContainerViewProxy={ContainerViewProxy} SettingProxy={SettingProxy} onSaveBeforeHandler={this.onSaveBeforeHandler} AddExtend={AddExtend} SettingExtend={SettingExtend} ContainerViewExtend={ContainerViewExtend}>
            </ContainerModle>
        )
    }
}